<template>
    <div>
        <el-dialog :visible="slryDialog" width="1150px" :before-close="slryClose">
            <div>
                <el-radio-group v-model="slryObj" @change="changeRadio" style="width: 100%;">
                    <table class="special_webucation_table" width="100%">
                        <thead>
                            <tr>
                                <th width="40px">序号</th>
                                <th width="100px">姓名</th>
                                <th width="220px">身份证号</th>
                                <th>专业（工种）/证书编号</th>
                                <th width="120px">有效日期</th>
                                <th width="90px">勾选专业</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr v-for="(item,index) in slryLists" :key="index">
                                <td width="40px">{{index+1}}</td>
                                <td width="100px">
                                    <a target="_blank" :href="item.originalUrl" title="点击查看个人信息">{{item.realName}}</a>
                                </td>
                                <td width="200px">{{item.identityCode}}</td>
                                <td>{{item.certificateName}} / {{item.certificateNumber}}</td>
                                <td width="100px">{{new Date(item.certificateEnddate).Format('yyyy-MM-dd')}}</td>
                                <td width="100px">
                                    <el-radio :label="item" :disabled="index!=0">&nbsp;</el-radio>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </el-radio-group>
                <el-form>
                    <el-form-item label="" class="choose_projects">
                        <div class="text_left" style="color: #333333;font-size: 16px;">
                            <p style="color: #ff0000;">
                                注：一人多证的,三年内只需参加一次培训即可,请选择即将办理延期的证书信息。
                            </p>
                        </div>
                    </el-form-item>
                </el-form>
            </div>
            <div class="text_center" style="margin-top: 50px;">
                <span slot="footer" class="dialog-footer">
                    <el-button @click="slryClose">取 消</el-button>
                    <el-button type="primary" @click="slryDialogFunc">确 定</el-button>
                </span>
            </div>
        </el-dialog>
    </div>
</template>

<script>
    var _this;
    export default {
        data() {
            return {
                slryDialog: false,
                slryLists: [],
                slryObj: {}
            }
        },
        beforeCreate: function() {
            _this = this;
        },
        methods: {
            getCertificates: function() {
                this.slryClose();
                this.slryDialog = true;
                this.common.post(this.api.getSlryListInfo, {}, function(res) {
                    _this.slryLists = res.resultMap;
                });
            },
            changeRadio: function(val) {},
            slryClose: function() {
                this.slryObj = {};
                this.slryLists = [];
                this.slryDialog = false;
            },
            slryDialogFunc: function() {
                if (String.isEmptyOrNUll(this.slryObj.id)) {
                    this.$message.error("请选择专业！");
                    return;
                }
                this.$emit("childByValue", this.slryObj);
                this.slryDialog = false;
            }
        }
    }
</script>

<style>
    .el-form-item.choose_projects .el-form-item__content {
        margin-left: 0 !important;
    }
</style>
